import { defineStore } from "pinia";
import piniaPersistConfig from "@/config/piniaPersist";

interface MenuState {
	isCollapse: boolean;
}

export const useMenuStore = defineStore("menu", {
	state: (): MenuState => {
		return { isCollapse: false };
	},
	actions: {
		setCollapse() {
			this.isCollapse = !this.isCollapse;
		}
	},
	// 持久化
	persist: piniaPersistConfig("MenuState")
});
